package com.suyang.syt.dao.impl;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.UserStoresDao;
import com.suyang.syt.model.UserStores;
@Repository
public class UserStoresDaoImpl extends BaseDaoImpl<UserStores> implements UserStoresDao {

	@Override
	public boolean isExistStore(long objid,int status,long userid) {
		String hql = " select count(*) from UserStores us where us.objid=? and us.status=? and us.userid=?";
		Long result = (Long) this.queryByHql(hql, new Object[]{objid,status,userid});
		if (result != 0) {
			return true;
		}
		return false;
	}

	@Override
	public void deleteByIds(String ids) throws Exception {
		this.executeByHql("delete UserStores where id in(" +ids+ ")");
		
	}

	@Override
	public boolean isExistByIds(String ids) {
		String hql = " select count(*) from UserStores us where us.id in(?)";
		Long result = (Long) this.queryByHql(hql, ids);
		if (result != 0) {
			return true;
		}
		return false;
	}

	
}
